# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=firstorder
pkgver=8.107eb6a
pkgrel=3
pkgdesc='A traffic analyzer to evade Empire communication from Anomaly-Based IDS.'
groups=('blackarch' 'blackarch-sniffer' 'blackarch-automation'
        'blackarch-exploitation')
arch=('any')
url='https://github.com/tearsecurity/firstorder'
license=('custom:BSD')
depends=('python2' 'python2-scapy' 'python2-requests' 'python2-scapy-http')
makedepends=('git')
source=("git+https://github.com/tearsecurity/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1s/^/#!\/usr\/bin\/env python2\n/' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md \
    firstorder_slide.pdf
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

